
package combat.dudes.server.protocol.implementation;

import gnu.cajo.invoke.Remote;

import java.rmi.RemoteException;

import combat.dudes.protocol.interfaces.OnboardWeaponSystemInt;
import combat.dudes.protocol.interfaces.OrderAttackInt;
import combat.dudes.protocol.types.OrderType;
import combat.dudes.server.ServerApp;


public class OrderAttack extends Order implements OrderAttackInt {

	private static final long serialVersionUID = 1L;

	public OrderAttack() {}
	public OrderAttack(Object target, OnboardWeaponSystemInt system) {
		super(target, OrderType.ATK);
		this.system = system;
	}

	private OnboardWeaponSystemInt system = null;
	@Override
	public OnboardWeaponSystemInt getSystem() {
		return system;
	}
	@Override
	public void setSystem(OnboardWeaponSystemInt system) {
		this.system = system;
	}
	@Override
	public Remote getSystem_Remote() {
		try {
			return new Remote(getSystem());
		} catch (RemoteException e) {
			ServerApp.onError("@OrderAttack.java, getSystem_Remote()", e, false);
		}
		return null;
	}
}
